Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cli-progress

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-progress

easy to use progress-bar for command-line/terminal applications

  • 3.12.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9M
decreased by-23.41%
Maintainers
1
Weekly downloads
 
Created

What is cli-progress?

The cli-progress package is a versatile library for Node.js designed to create customizable progress bars in the command line interface (CLI). It supports various styles, custom tokens, and can handle multiple bars simultaneously, making it suitable for applications that require real-time progress feedback.

What are cli-progress's main functionalities?

Single Progress Bar

This demonstrates how to create a simple progress bar that updates from 0 to 50 out of 100. It uses the 'shades_classic' preset for styling.

const cliProgress = require('cli-progress');
const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
bar.start(100, 0);
bar.update(50);
bar.stop();

Multiple Progress Bars

This example shows how to manage multiple progress bars simultaneously. It creates two bars with different total values and updates them independently.

const cliProgress = require('cli-progress');
const multiBar = new cliProgress.MultiBar({ clearOnComplete: false, hideCursor: true }, cliProgress.Presets.shades_grey);
const bar1 = multiBar.create(200, 0);
const bar2 = multiBar.create(100, 0);
bar1.increment();
bar2.update(20);
multiBar.stop();

Custom Tokens

This code snippet illustrates how to use custom tokens within the progress bar format. It displays additional information like speed alongside the progress.

const cliProgress = require('cli-progress');
const customBar = new cliProgress.SingleBar({ format: 'Progress |{bar}| {percentage}% || {value}/{total} Chunks || Speed: {speed}' }, cliProgress.Presets.shades_classic);
customBar.start(100, 0, { speed: 'N/A' });
customBar.update(40, { speed: '4MB/s' });
customBar.stop();

Other packages similar to cli-progress

Keywords

FAQs

Package last updated on 19 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc